import java.util.Scanner;
public class Recursion {
        public static void main(String[] args) {
            Scanner sc=new Scanner(System.in);
            int n= sc.nextInt();
            System.out.println(JC(n));
        }
        public static int JC(int n){              //递归求N的阶乘
            if(n==1){
                return 1;
            }
            int temp=n*JC(n-1);
            return temp;
        }
    }

import java.util.Scanner;
public class Recursion {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        System.out.println(sum(n));
    }
    public static int sum(int n){                            //递归求和
        if(n==1){
            return 1;
        }
        int temp=n+sum(n-1);
        return temp;
    }
}

import java.util.Scanner;
public class Recursion {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        print(n);
    }

    public static void print(int n) {                       //递归打印每一位数
        if (n <= 9) {
            System.out.println(n);;
        } else {
            print(n / 10);
            System.out.println(n%10);
        }
    }
}

import java.util.Scanner;
public class Recursion {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(sum_print(n));
    }

    public static int sum_print(int n) {
        if (n <= 9) {                                           //写一个递归方法，输入一个非负整数，返回组成它的数字之和
            return n;
        } else {
            int sum=n%10+sum_print(n/10);
            return sum;
        }
    }
}

import java.util.Scanner;
public class Recursion {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fib(n));
    }

    public static int fib(int n) {                                //递归求斐波那契数列的第 N 项
        if(n==1||n==2){
            return 1;
        }
        return fib(n-1)+fib(n-2);
    }
}